﻿@model INTREPWEB.Models.EmbarqueViewModel
@{
    ViewBag.Title = "Editar Embarque";

    if (IsAjax)
    {
        Layout = null;
        <script type="text/javascript">
            carregaItens('@Model.Id');
        </script>
    }
    else
    {
    <text>
    @section Scripts{
        <script type="text/javascript">
            carregaItens('@Model.Id');
        </script>
    }
    </text>
    }
}
@using (Html.BeginForm())
{
    @Html.HiddenFor(model => model.Id)

    @Html.Partial("CreateEdit")


    <fieldset>
        <legend>Itens</legend>
        <div style="text-align: right">
            @Ajax.ActionLink("Adicionar", "Criar", "Item", new { id = Model.Id }, new AjaxOptions { OnBegin = "criaModal('criaritem')", UpdateTargetId = "criaritem", OnSuccess = "$.modalPopup('criaritem', 'Item', '" + Model.Id + "')" }, new { @class = "ui-button" })
        </div>
        <div id="progressparcial" style="display: none; margin-top: -30px; text-align: center">
            <img src="/Content/preloader-120x60.gif" /></div>
        <br />
        @*    <div id="itensdoembarque">
    </div>*@
        <div id="ItemParcial">
            @*@Html.Action("Item", "Parcial", new { id = Model.Id })*@
        </div>
    </fieldset>


    @Html.Partial("_SubmitBar")
}